﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NetworkLib.Utilities;

namespace PokemonBattle.BattleRoom.Server
{
    public class RoomBattleSetting : DataByteArray
    {
        public int MoveInterval { get; set; }
        public bool SingleBan { get; set; }
        public bool DoubleBan { get; set; }
        public bool FourPlayerBan { get; set; }
        public bool RandomOnly { get; set; }
        public string Version { get; set; }

        #region abstract

        public override void Read(ByteArray byteArray)
        {
            MoveInterval = byteArray.ReadInt();
            SingleBan = byteArray.ReadBoolean();
            DoubleBan = byteArray.ReadBoolean();
            FourPlayerBan = byteArray.ReadBoolean();
            RandomOnly = byteArray.ReadBoolean();
            Version = byteArray.ReadUTF();
        }

        public override void Write(ByteArray byteArray)
        {
            byteArray.WriteInt(MoveInterval);
            byteArray.WriteBoolean(SingleBan);
            byteArray.WriteBoolean(DoubleBan);
            byteArray.WriteBoolean(FourPlayerBan);
            byteArray.WriteBoolean(RandomOnly);
            byteArray.WriteUTF(Version);
        }

        #endregion

    }
}
